home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
boostrs.arc
/
HEAPAT.ASM
< prev
next >
Wrap
Assembly Source File
|
1985-10-06
|
2KB
|
82 lines
;**************************************************
;
; Procedure HEAPAT( Page : HeapBuf;
; X1,Y1,X2,Y2 : Integer;
; Attribute : Byte );
;
; Sets heap attributes on Page [n]
; for the block at X1,Y1 (upper left)
; X2,Y2 (lower right)
;
;**************************************************
HEAPAT proc near
push bp
mov bp,sp
push ds
;
;
;*** Compute number of lines to move
;
mov ax,[bp+10] ; value of Y1 into AX
mov dx,[bp+06] ; value of Y2 into CX
sub dx,ax ; DX = Y2 - Y1
inc dx ; DX = Number of lines
push dx
;
;
;*** Compute length of each move
;
mov ax,[bp+12] ; X1
mov cx,[bp+08] ; X2
sub cx,ax ; CX = X2 - X1
inc cx ; CX = num WORDS/line
push cx
;
;*** Get Page [n] address on Heap
;
mov di,[bp+14]
mov ax,[bp+16]
mov es,ax
;
;*** Compute upper left offset of block
;
add di,[bp+10] ; Add Y1 to DI
dec di ; (Y1-1)
mov dx,di ; Save in DX
mov cl,7
shl dx,cl ; (Y1-1) * 128
mov cl,5
shl di,cl ; (Y1-1) * 32
add di,dx ; (Y1-1) * 160
mov ax,[bp+12] ; X1 into AX
dec ax ; (X1-1)
shl ax,1 ; 2 * (X1-1)
add di,ax ; offset
inc di ; odd location
;
pop cx ; Num words/line
pop dx ; Num lines to blank
;
;*** Set attribute byte for given block
;
mov ax,[bp+04] ; attribute
cld
AGAIN: push cx
DO: stosb
inc di
loop do
;
pop cx
dec dx
jz DONE2
add di,160
sub di,cx
sub di,cx
jmp AGAIN
;
DONE2: pop ds
mov sp,bp
pop bp
ret 14
HEAPAT endp